/* 非持久化
import { createStore ,combineReducers} from 'redux'
import {CollApsedReducer} from './reduces/CollapsedReducer'
import {LoadingReducer} from './reduces/LoadingReducer'

// combineReducers用来管理多个reduce
const reducer = combineReducers({
  CollApsedReducer,
  LoadingReducer
})
// 创建store
const store = createStore(reducer)

export default store
*/
//-----------------------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------------------
// 持久化 cnpm i -S redux-persist  // App.js也需要修改！！！！！！！！
import { createStore ,combineReducers} from 'redux'
import {CollApsedReducer} from './reduces/CollapsedReducer'
import {LoadingReducer} from './reduces/LoadingReducer'
import { persistStore, persistReducer } from 'redux-persist'
import storage from 'redux-persist/lib/storage'  // 默认为 web 的 localStorage

// 定义持久化存储信息
const persistConfig = {
  // key关键字
  key: 'Pierce（QQ:15379653）',
  // 存储在localStorage
  storage,
  // 持久化黑名单[排除不需要持久化的reducer]
  blacklist: ['LoadingReducer'] 
}

const reducer = combineReducers({
  CollApsedReducer,
  LoadingReducer
})

// 定义持久化Reducer
const persistedReducer = persistReducer(persistConfig, reducer)

const store = createStore(persistedReducer)
// 持久化store
const persistor = persistStore(store)

export { store, persistor } 

